﻿using MediatR;
using SheepStorage.API.Application.Command.YourTableNameCommand;
using SheepStorage.API.Baseclass;
using SheepStorage.Domain.Entity;
using SheepStorage.Service.Interface;

namespace SheepStorage.API.Application.CommandHandler
{
    public class YourTableNameAuditCommandHandler : IRequestHandler<YourTableNameAuditCommand, Results<int>>
    {
        private readonly IYourTableNameService _yourTableNameService;
        public YourTableNameAuditCommandHandler(IYourTableNameService yourTableNameService)
        {
            _yourTableNameService = yourTableNameService;
        }
        public async Task<Results<int>> Handle(YourTableNameAuditCommand request, CancellationToken cancellationToken)
        {
            return Results<int>.DataResult(await _yourTableNameService.AuditYourTableName(request.DawningsheepId));
        }
    }
}
